﻿using AbstractProducts;
using Newtonsoft.Json;

namespace JiraRest
{
    internal sealed class ProductRefConverter : TypeConverter<ProductRef>
    {
        protected override ProductRef Read(JsonReader reader)
        {
            return new ProductRef(reader.Value.ToString());
        }

        protected override void Write(JsonWriter writer, ProductRef value)
        {
            writer.WriteValue(value.ProductName);
        }
    }
}
